﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace RLGDashboard
{
    public partial class RangeForm : Form
    {

        public Int32 min
        { get; set; }
        public Int32 max
        { get; set; }
        public String color
        { get; set; }

        public RangeForm(Int32 inMin, Int32 inMax)
        {
            min = inMin;
            max = inMax;

            InitializeComponent();
        }

        private void addButton_Click(object sender, EventArgs e)
        {
            if (numericMin.Value >= numericMax.Value)
            {
                MessageBox.Show("Your min may not be higher than your max.");
            }
            else
            {
                this.DialogResult = DialogResult.OK;
                this.Close();
            }
        }

        private void cancelButton_Click(object sender, EventArgs e)
        {
            this.DialogResult = DialogResult.Cancel;
            this.Close();
        }

        private void numericMin_ValueChanged(object sender, EventArgs e)
        {
            this.min = (Int16)numericMin.Value;
        }

        private void numericMax_ValueChanged(object sender, EventArgs e)
        {
            this.max = (Int16)numericMax.Value;
        }

        private void colorComboBox1_SelectedValueChanged(object sender, EventArgs e)
        {
            this.color = colorSelector.Text;
        }
    }
}
